use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Material {
    pub id: Option<i32>,
    pub name: Option<String>,
    pub code: Option<String>,
    pub parent_id: i32,
    pub supplier_id: Option<i32>,            //供应商id
    pub color_code: Option<String>,          //颜色代码
    pub background_material: Option<String>, //背面材料
    pub status: i32,
    pub length: Option<f32>,
    pub width: Option<f32>,
    pub thickness: Option<f32>, //厚度
    pub residual: Option<f32>,  //误差
    pub price: Option<i32>,     //实际数值应该除以10000
    pub unit: Option<String>,   //货币单位，元，美元
    pub remark: Option<String>,
    pub is_leaf: Option<bool>, //是否是叶子节点, 默认为空，非叶子节点

    #[serde(skip)]
    pub created_by: String,
    #[serde(skip)]
    pub modified_by: String,
    #[serde(skip)]
    pub created_at: chrono::NaiveDateTime,
    #[serde(skip)]
    pub modified_at: chrono::NaiveDateTime,
}
